#pragma once
#include <BasisObj.h>
#include <SDKmesh.h>
#include <string>
#include <w32lib_basic.h>
#include <vector>
#include <boost/shared_ptr.hpp>

namespace grflib
{
	namespace engine
	{
		namespace aux
		{
			class CXMesh : public grflib::engine::core::IRenderable
			{
			public:
				CXMesh(void);
				virtual ~CXMesh(void);

				virtual HRESULT OnCreateDevice(ID3D10Device *pd3dDevice,
					const DXGI_SURFACE_DESC *pBufferSurfaceDesc);
				virtual HRESULT OnRender(ID3D10Device *pd3dDevice,
					const D3DXMATRIX *pWorldMat,
					double fTime,
					float fElapsedTime,
                    UINT pass);
				virtual void OnDestroy(void);

				void SetFilename(TCHAR *fn);
				void SetEffectTechnique(const std::string &effectName, const std::string &techName);

			protected:
				CDXUTSDKMesh m_mesh;
				_TSTRING m_filename;
				std::string m_effectName;
				std::string m_techniqueName;
				std::vector< boost::shared_ptr<std::vector<D3D10_INPUT_ELEMENT_DESC>> > m_pVertexLayouts;
			};

		} //namespace aux
	} //namespace engine
} //namespace grflib